import request from '@/utils/request'

// 查询告警信息列表
export function listAlarm(query) {
  return request({
    url: '/biz/alarm/list',
    method: 'get',
    params: query
  })
}

// 查询告警信息详细
export function getAlarm(id) {
  return request({
    url: '/biz/alarm/' + id,
    method: 'get'
  })
}

// 新增告警信息
export function addAlarm(data) {
  return request({
    url: '/biz/alarm',
    method: 'post',
    data: data
  })
}

// 修改告警信息
export function updateAlarm(data) {
  return request({
    url: '/biz/alarm',
    method: 'put',
    data: data
  })
}

// 删除告警信息
export function delAlarm(id) {
  return request({
    url: '/biz/alarm/' + id,
    method: 'delete'
  })
}

// 导出告警信息
export function exportAlarm(query) {
  return request({
    url: '/biz/alarm/export',
    method: 'get',
    params: query
  })
}

// 确认告警信息
export function confirmAlarm(id) {
	const data = {
    id
  }
  return request({
    url: '/biz/alarm/confirmAlarm',
    method: 'post',
    data: data
  })
}
// 忽略告警信息
export function ignoreAlarm(id) {
	const data = {
    id
  }
  return request({
    url: '/biz/alarm/ignoreAlarm',
    method: 'post',
    data: data
  })
}

// 查询告警汇总
export function selectAlarmTotal() {
  return request({
    url: '/biz/alarm/selectAlarmTotal',
    method: 'get'
  })
}
// 查询周告警汇总
export function selectWeekAlarmList() {
  return request({
    url: '/biz/alarm/selectWeekAlarmList',
    method: 'get'
  })
}
// 查询当天告警汇总
export function selectOneDayAlarmList() {
  return request({
    url: '/biz/alarm/selectOneDayAlarmList',
    method: 'get'
  })
}

//告警确认和未确认信息统计
export function selectAlarmStatusTotal(){
  return request({
    url: '/biz/alarm/selectAlarmStatusTotal',
    method: 'get'
  })
}

//告警统计分析
export function selectAlarmStatistic(query){
  return request({
    url: '/biz/alarm/selectAlarmStatistic',
    method: 'get',
    params: query
  })
}
